package com.qingcheng.dao;

import com.qingcheng.pojo.goods.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {

    @Select("SELECT ts.name,ts.options" +
            " FROM tb_spec ts," +
            " (SELECT DISTINCT template_id" +
            " FROM tb_category" +
            " WHERE name=#{categoryName}) tc" +
            " WHERE tc.template_id=ts.template_id")
    public List<Map> findListByCategoryName(@Param("categoryName") String categoryName);

}
